using Core;

namespace g_gongjianta
{
    public class Bow : Unit, IAwake<TblAnchor.WeaponConf>
    {
        public TblAnchor.WeaponConf Conf { get; private set; }

        public BowMainComponent Main { get; private set; }

        public void Awake(TblAnchor.WeaponConf t)
        {
            base.Awake();

            Conf = t;

#if UNITY_EDITOR
            gameObject.name = $"Bow_{InstanceId}";
#endif

            var visualParam = new VisualParam
            {
                Path = Global.UNIT_PREFAB_PATH,
                Icon = Conf.Icon,
                SortingOrder = 1,
            };
            Add<VisualComponent, VisualParam>(visualParam);

            Main = Add<BowMainComponent>();
        }
    }
}